import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/security_control_entity.dart';
import 'package:safetymonitor/app/data/common/choice_bean.dart';


SecurityControlEntity $SecurityControlEntityFromJson(Map<String, dynamic> json) {
  final SecurityControlEntity securityControlEntity = SecurityControlEntity();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    securityControlEntity.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    securityControlEntity.updateTime = updateTime;
  }
  final String? creator = jsonConvert.convert<String>(json['creator']);
  if (creator != null) {
    securityControlEntity.creator = creator;
  }
  final String? updater = jsonConvert.convert<String>(json['updater']);
  if (updater != null) {
    securityControlEntity.updater = updater;
  }
  final bool? deleted = jsonConvert.convert<bool>(json['deleted']);
  if (deleted != null) {
    securityControlEntity.deleted = deleted;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    securityControlEntity.id = id;
  }
  final String? activityName = jsonConvert.convert<String>(json['activityName']);
  if (activityName != null) {
    securityControlEntity.activityName = activityName;
  }
  final int? securityControlRiskPointId = jsonConvert.convert<int>(json['securityControlRiskPointId']);
  if (securityControlRiskPointId != null) {
    securityControlEntity.securityControlRiskPointId = securityControlRiskPointId;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    securityControlEntity.companyId = companyId;
  }
  final int? responsibleDeptId = jsonConvert.convert<int>(json['responsibleDeptId']);
  if (responsibleDeptId != null) {
    securityControlEntity.responsibleDeptId = responsibleDeptId;
  }
  final int? responsibleUserId = jsonConvert.convert<int>(json['responsibleUserId']);
  if (responsibleUserId != null) {
    securityControlEntity.responsibleUserId = responsibleUserId;
  }
  final int? recognizeDeptId = jsonConvert.convert<int>(json['recognizeDeptId']);
  if (recognizeDeptId != null) {
    securityControlEntity.recognizeDeptId = recognizeDeptId;
  }
  final int? recognizeUserId = jsonConvert.convert<int>(json['recognizeUserId']);
  if (recognizeUserId != null) {
    securityControlEntity.recognizeUserId = recognizeUserId;
  }
  final int? longitude = jsonConvert.convert<int>(json['longitude']);
  if (longitude != null) {
    securityControlEntity.longitude = longitude;
  }
  final int? latitude = jsonConvert.convert<int>(json['latitude']);
  if (latitude != null) {
    securityControlEntity.latitude = latitude;
  }
  final int? height = jsonConvert.convert<int>(json['height']);
  if (height != null) {
    securityControlEntity.height = height;
  }
  return securityControlEntity;
}

Map<String, dynamic> $SecurityControlEntityToJson(SecurityControlEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['creator'] = entity.creator;
  data['updater'] = entity.updater;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['activityName'] = entity.activityName;
  data['securityControlRiskPointId'] = entity.securityControlRiskPointId;
  data['companyId'] = entity.companyId;
  data['responsibleDeptId'] = entity.responsibleDeptId;
  data['responsibleUserId'] = entity.responsibleUserId;
  data['recognizeDeptId'] = entity.recognizeDeptId;
  data['recognizeUserId'] = entity.recognizeUserId;
  data['longitude'] = entity.longitude;
  data['latitude'] = entity.latitude;
  data['height'] = entity.height;
  return data;
}

extension SecurityControlEntityExtension on SecurityControlEntity {
  SecurityControlEntity copyWith({
    String? createTime,
    String? updateTime,
    String? creator,
    String? updater,
    bool? deleted,
    int? id,
    String? activityName,
    int? securityControlRiskPointId,
    int? companyId,
    int? responsibleDeptId,
    int? responsibleUserId,
    int? recognizeDeptId,
    int? recognizeUserId,
    int? longitude,
    int? latitude,
    int? height,
  }) {
    return SecurityControlEntity()
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..creator = creator ?? this.creator
      ..updater = updater ?? this.updater
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..activityName = activityName ?? this.activityName
      ..securityControlRiskPointId = securityControlRiskPointId ?? this.securityControlRiskPointId
      ..companyId = companyId ?? this.companyId
      ..responsibleDeptId = responsibleDeptId ?? this.responsibleDeptId
      ..responsibleUserId = responsibleUserId ?? this.responsibleUserId
      ..recognizeDeptId = recognizeDeptId ?? this.recognizeDeptId
      ..recognizeUserId = recognizeUserId ?? this.recognizeUserId
      ..longitude = longitude ?? this.longitude
      ..latitude = latitude ?? this.latitude
      ..height = height ?? this.height;
  }
}